package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.BsbCardMapper;
import com.bsb.base.model.BsbCard;
import com.bsb.base.model.BsbCardExample;
import com.bsb.base.model.BsbUserExample;

@Service
public class BsbCardService{
	
	@Resource
	private BsbCardMapper bsbCardMapper;
	
	public void addBsbCard(BsbCard bsbCard) {
		bsbCardMapper.insertSelective(bsbCard);
	}
	
	public void delBsbCardById(Long id) {
		bsbCardMapper.deleteByPrimaryKey(id);
	}
	
	public void updateBsbCard(BsbCard bsbCard) {
		bsbCardMapper.updateByPrimaryKeySelective(bsbCard);
	}
	
	public void updateBsbCardByExample(BsbCard bsbCard,BsbCardExample bsbCardExample){
	    bsbCardMapper.updateByExampleSelective(bsbCard,bsbCardExample);
	}
	
	public BsbCard getBsbCardById(Long id) {
		return bsbCardMapper.selectByPrimaryKey(id);
	}
	
	public List<BsbCard> getPageBsbCard(BsbCardExample bsbCardExample) {
		return bsbCardMapper.selectPage(bsbCardExample);
	}
	
	public int countBsbCard(BsbCardExample bsbCardExample) {
		return bsbCardMapper.countByExample(bsbCardExample);
	}
	
	public int countCard(BsbCardExample bsbCardExample,BsbUserExample bsbUserExample){
		int count = bsbCardMapper.countByLike(bsbCardExample,bsbUserExample);
		return count;
	}
	
	public List<BsbCard> selectByExample(BsbCardExample example){
	    return bsbCardMapper.selectByExample(example);
	}

	public List<BsbCard> getPageCardLike(BsbCardExample bsbCardExample, BsbUserExample userExample) {
		return bsbCardMapper.getPageCardLike(bsbCardExample,userExample);
	}
}
